package com.xiaolong.sojiaziademo.dump;

import com.xiaolong.sojiaziademo.BuildConfig;
import com.xiaolong.sojiaziademo.Native;
import com.xiaolong.sojiaziademo.enums.PackerEnums;
import com.xiaolong.sojiaziademo.util.FileUtils;
import com.xiaolong.sojiaziademo.util.Logger;
import com.xiaolong.sojiaziademo.util.Zprint;

import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * OreoDump
 *
 * @author WrBug
 * @since 2018/3/23
 */
public class OreoDump {
    private final static String TAG = OreoDump.class.getName();

    public static void log(String txt) {
        if (!BuildConfig.DEBUG) {
            return;
        }
        XposedBridge.log("dumpdex-> " + txt);
    }

    public static void init(final XC_LoadPackage.LoadPackageParam lpparam) {
        Zprint.log(OreoDump.class,"OreoDump::init -> " + lpparam);
        String soLibPath = FileUtils.getInstallationDirectory(PackerEnums.THIS_PLUGIN);
        Native.getInner(soLibPath).dump(lpparam.packageName);
    }
}
